import pytest, time
from selenium.webdriver.common.by import By


class AdminExportingRecordLocator:
    """
          admin portal 页面
         """
    # admin portal 页面
    admin_portal_page = (By.CSS_SELECTOR, '[id="root"]')
    # 初始页面展开的tab
    default_page_expanded = (By.CSS_SELECTOR, '[aria-expanded="true"]')

    # Order Management_tab
    order_management_tab = (By.XPATH, "//div[contains(@data-menu-id,'ORDER_MANAGEMENT_PLT')]")

    # admin portal 页面左侧栏的Order Management下的Orders 按钮
    order_management_orders_tittle = (By.CSS_SELECTOR, '[path="/console/orderManagement/order"]')
    # admin portal 页面左侧栏的Order Management下的My Resource按钮
    order_management_resource_tittle = (By.CSS_SELECTOR, '[path="/console/orderManagement/myResource"]')
    # admin portal 页面左侧栏的Order Management下的Usage Query按钮
    order_management_usage_query_tittle = (By.CSS_SELECTOR, '[path="/console/orderManagement/usageQuery"]')
    # admin portal 页面左侧栏的Order Management下的Resource Packages按钮
    order_management_resource_packages_tittle = (By.CSS_SELECTOR, '[path="/console/orderManagement/packages"]')
    # admin portal的Order Management下的Orders页面
    order_management_orders_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Order Management下的My Resource页面
    order_management_resource_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Order Management下的Usage Query页面
    order_management_usage_query_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Order Management下的Resource Packages页面
    order_management_resource_packages_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')

    # Order Management下的My Resource页面下载按钮
    order_management_resource_download_btn = (By.CSS_SELECTOR, '[class="anticon anticon-download"]')
    # Order Management下的My Resource页面下载跳转页面标题 Export Records
    my_resource_download_jump_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')
    # My Resource页面下载跳转页面File Name字段
    my_resource_download_jump_file_name = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[1]')
    # My Resource页面下载跳转页面Module字段
    my_resource_download_jump_module = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[2]')
    # My Resource页面下载跳转页面Status字段
    my_resource_download_jump_status = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[3]/div/span[1]')
    # My Resource页面下载跳转页面Creation Time字段
    my_resource_download_jump_creation_time = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[4]')
    # My Resource页面下载跳转页面Actions字段
    my_resource_download_jump_actions = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[5]')

    # Orders页面日期选择框
    orders_date_input = (By.XPATH, '(//*[@class="antd4-form-item-control-input-content"])[3]')
    # Orders页面开始日期选择框
    orders_date_start_input = (By.XPATH, '(//*[@class="antd4-picker-cell-inner"])[2]')
    # Orders页面结束日期选择框
    orders_date_end_input = (By.XPATH, '(//*[@class="antd4-picker-cell-inner"])[3]')
    # Order Management下的Orders页面下载按钮
    order_management_orders_download_btn = (By.CSS_SELECTOR, '[class="anticon anticon-download"]')
    # Order Management下的Orders页面下载跳转页面标题 Export Records
    orders_download_jump_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')
    # Orders页面下载跳转页面File Name字段
    orders_download_jump_file_name = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[1]')
    # Orders页面下载跳转页面Module字段
    orders_download_jump_module = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[2]')
    # Orders页面下载跳转页面Status字段
    orders_download_jump_status = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[3]/div/span[1]')
    # Orders页面下载跳转页面Creation Time字段
    orders_download_jump_creation_time = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[4]')
    # Orders页面下载跳转页面Actions字段
    orders_download_jump_actions = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[5]')

    # Bill_tab
    bill_tab = (By.XPATH, "//div[contains(@data-menu-id,'BILLS_PLT')]")

    # admin portal 页面左侧栏的Bill下的Spending Summary按钮
    bill_spending_summary_tittle = (By.CSS_SELECTOR, '[path="/console/bills"]')
    # admin portal 页面左侧栏的Bill下的Billing Statement按钮
    bill_billing_statement_tittle = (By.CSS_SELECTOR, '[path="/console/billStatement"]')
    # admin portal 页面左侧栏的Bill下的Amount Adjustment按钮
    bill_amount_adjustmen_tittle = (By.CSS_SELECTOR, '[path="/console/adjust"]')
    # admin portal 页面左侧栏的Bill下的Income/Expense按钮
    bill_income_expense_tittle = (By.CSS_SELECTOR, '[path="/console/incomeExpense"]')
    # admin portal的Bill下的Spending Summary页面
    bill_spending_summary_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Billt下的Billing Statement页面
    bill_billing_statement_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Bill下的Amount Adjustment页面
    bill_amount_adjustmen_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')
    # admin portal的Bill下的Income/Expense页面
    bill_income_expense_page = (By.XPATH, '(//div[@class="cre-page-container-header-panel-left"])/span')

    # Income/Expense页面日期选择框
    income_expense_date_input = (By.XPATH, '(//*[@class="antd4-form-item-control-input-content"])[2]')
    # Income/Expense页面开始日期选择框
    income_expense_date_start_input = (By.XPATH, '(//*[@class="antd4-picker-cell-inner"])[2]')
    # Income/Expense页面结束日期选择框
    income_expense_date_end_input = (By.XPATH, '(//*[@class="antd4-picker-cell-inner"])[3]')
    # Bill下的Income/Expense页面下载按钮
    bill_income_expense_download_btn = (By.CSS_SELECTOR, '[class="anticon anticon-download"]')
    # Bill下的Income/Expense页面点击下载按钮报错提示语 Please select start date and end date for export. The export time range cannot exceed 6 months.
    download_error_tips = (By.XPATH, '(//*[@class="antd4-message-notice"])/div/div/span[2]')
    # Bill下的Income/Expense页面下载跳转页面标题 Export Records
    income_expense_download_jump_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')
    # Income/Expense页面下载跳转页面File Name字段
    income_expense_download_jump_file_name = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[1]')
    # Income/Expense页面下载跳转页面Module字段
    income_expense_download_jump_module = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[2]')
    # Income/Expense页面下载跳转页面Status字段
    income_expense_download_jump_status = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[3]/div/span[1]')
    # Income/Expense页面下载跳转页面Creation Time字段
    income_expense_download_jump_creation_time = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[4]')
    # Income/Expense页面下载跳转页面Actions字段
    income_expense_download_jump_actions = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[5]')

    # Bill下的Billing Statement页面下载按钮
    bill_billing_statement_download_btn = (By.CSS_SELECTOR, '[class="anticon anticon-download"]')
    # Bill下的Billing Statement页面下载跳转页面标题 Export Records
    billing_statement_download_jump_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')
    # Billing Statement页面下载跳转页面File Name字段
    billing_statement_download_jump_file_name = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[1]')
    # Billing Statement页面下载跳转页面Module字段
    billing_statement_download_jump_module = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[2]')
    # Billing Statement页面下载跳转页面Status字段
    billing_statement_download_jump_status = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[3]/div/span[1]')
    # Billing Statement页面下载跳转页面Creation Time字段
    billing_statement_download_jump_creation_time = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[4]')
    # Billing Statement页面下载跳转页面Actions字段
    billing_statement_download_jump_actions = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[5]')

    # Bill下的Billing Statement页面下载跳转页面Status字段的Being Generated状态
    billing_statement_download_status_generated = (By.XPATH, '(//*[@class="antd4-table-tbody"])/tr[2]/td[3]/span/span[2]')
    # Billing Statement页面下载跳转页面Status字段的Export successful状态
    billing_statement_download_jump_status_successful = (By.XPATH, '(//*[@class="antd4-table-tbody"])/tr[2]/td[3]/span/span[2]')

    # Order Management-Orders页面下载跳转页面Status字段的Being Generated状态
    orders_download_status_generated = (By.XPATH, '(//*[@class="antd4-table-tbody"])/tr[2]/td[3]/span/span[2]')
    # Order Management-Orders页面下载跳转页面Status字段的Export successful状态
    orders_download_jump_status_successful = (By.XPATH, '(//*[@class="antd4-table-tbody"])/tr[2]/td[3]/span/span[2]')


